package channel;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

public class SaveInXML 
{
	
	public static void saveAsXML(String filename, byte[] protoData)
	{
		  FileOutputStream ftxt = null;
		  String file = null;
		  try
		  {
		   
			  if(filename != null) 
			  {
				  file = "D:\\" + filename + System.currentTimeMillis() + ".xml" ;
				  ftxt = new FileOutputStream(new File(file));
				  ftxt.write(protoData);
				  new UCSDataUnmarshal(file);
			  }
		  }
		  catch(Throwable t) 
		  {
			  //Throwable
		  } 
		  finally 
		  {
			  if(ftxt != null) 
			  {
				  try
				  {
					  ftxt.close();
				  }
				  catch (IOException e) 
				  {
				  }
			  }
		  }
	}
	
	
	
	
	
}
